<?php

Yii::import('application.models._base.BaseCustomerInfo');


class CustomerInfo extends BaseCustomerInfo
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	
	public function rules() {
	    return array(
	        array('phone,first_name,last_name','required'),
	        array('birthday','required'),
	        array('customer_id, zip_code, states, phone, need_check_login, close_newuser_ins', 'numerical', 'integerOnly'=>true),
	        array('first_name, last_name, address, city, avatar, ip, refer', 'length', 'max'=>255),
	        array('BIO', 'safe'),
	        array('id, customer_id, first_name, last_name, address, city, zip_code, states, phone, BIO, birthday, avatar, ip, refer, need_check_login, close_newuser_ins', 'safe', 'on'=>'search'),
	        array('zip_code','match','pattern'=>'/^[0-9]{5}$/','message'=>'Zip_code wrong format'),
	    );
	}
}